package br.com.millenium.service.equipe.processaction;

import br.com.millenium.domain.manager.MilleniumManagerFactory;
import lumis.doui.processaction.ProcessActionHandler;
import lumis.portal.PortalException;

@SuppressWarnings("rawtypes")
public class CheckDuplicateEquipeProcessActionHandler extends ProcessActionHandler 
{
	@Override
	public void processAction() throws PortalException 
	{
		String equipeNome = (String)getParameter ( "nome" );
		String equipeId   = (String)(getParameter( "id"   ) == null ? "" : getParameter( "id" ));
		
		if( MilleniumManagerFactory.getEquipeManager().isDuplicateEquipe(equipeId, equipeNome, transaction))
			throw new PortalException( "STR_EQUIPE_EXISTS;", getResource() );
	}
}
